import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

/**
 * @description:
 * @Author Felix Torn
 * @create: 2024-06-08 19:39
 **/
public class Main {
    public static volatile long StartTime = System.currentTimeMillis();

    static String zipFilePath = "./standard.zip";
    static String passwordsFilePath = "./password.txt";
    static String extractedFilePath = "./";
    static int n = 10;
    public static void main(String[] args) throws IOException {
//        读取密码字典
        List<List<String>> dividedLines = Utils.getDividedLines(passwordsFilePath, n);
//        读取压缩包
        byte[] zipData = Files.readAllBytes(Paths.get(zipFilePath));
//        创建线程
        Thread[] threads = new Thread[n];
        for (int i = 0; i < n; i++) {
            threads[i] = new Thread(new ZipPasswordCracker(zipData,extractedFilePath,dividedLines.get(i)));
        }
        for (Thread thread : threads) {
            thread.start();
        }
    }
}
